#include <QtGui/QApplication>
#include <QtCore>
#include <QTextCodec>

#include "sina/account.h"
#include "sina/sinaweibo.h"
#include "mainwidget.h"
#include "rss/rssreader.h"

int main(int argc, char *argv[])
{
    /*
    QApplication withu(argc, argv);
    QApplication::setApplicationName("WithU");
    QApplication::addLibraryPath(QDir::home().absolutePath());

    QTextCodec *encoding = QTextCodec::codecForName("utf-8");
    QTextCodec::setCodecForTr(encoding);
    QTextCodec::setCodecForLocale(encoding);
    QTextCodec::setCodecForCStrings(encoding);

    Account *account = new Account();


    LoginDialog *loginDialog = new LoginDialog(account);
    if(loginDialog->exec()==QDialog::Accepted)
    {
        QApplication::setQuitOnLastWindowClosed(false);
        MainWindow w(account);
        w.show();
        return withu.exec();
    }


    return 0;
    */

    QApplication app(argc,argv);
    QTextCodec *encoding = QTextCodec::codecForName("utf-8");
    QTextCodec::setCodecForTr(encoding);
    QTextCodec::setCodecForLocale(encoding);
    QTextCodec::setCodecForCStrings(encoding);
    /*
    SinaMainWindow w;
    w.show();
    */
    /*
    MainWidget w;
    Account *pAccount = new Account;
    pAccount->setUsername("2191195@qq.com");
    pAccount->setPassword("31415926");
    LoginDialog *pDialog = new LoginDialog(pAccount);
    QString accessToken, accessTokenSecret;
    pDialog->getAccessToken(accessToken,accessTokenSecret);
    SinaWeibo *pWeibo = new SinaWeibo(pAccount);
    pWeibo->initHomePageStatus();
    pWeibo->initEmotions();
    qDebug(pWeibo->contentFrame.toLocal8Bit());
    w.show();
    */
    MainWidget w;
    w.show();

/*
    Account *pAccount = new Account;
    LoginDialog *pDialog = new LoginDialog(pAccount);
    pDialog->checkAuthStart();

    */
    return app.exec();

}
